package services

import (
	"time"
	"toy-car/pkg/setting"
)

func GetRedisJWT(userName string) (err error, redisJWT string) {
	redisJWT, err = setting.RedisInstance.Get(userName).Result()
	return err, redisJWT
}

func SetRedisJWT(jwt string, userName string) (err error) {
	// 此处过期时间等于jwt过期时间
	timer := time.Duration(100) * time.Second
	err = setting.RedisInstance.Set(userName, jwt, timer).Err()
	return err
}
